import 'package:flutter/material.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:sc1_manage_tool/theme/colors.dart';
import 'package:sc1_manage_tool/ui/webrtc/rtc_view.dart';

class DevicePage extends StatefulWidget {
  const DevicePage({super.key});

  @override
  State<DevicePage> createState() => _DevicePageState();
}

class _DevicePageState extends State<DevicePage> {
  final RTCVideoRenderer _rtcVideoRenderer = RTCVideoRenderer();

  @override
  void initState() {
    _rtcVideoRenderer.initialize();
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      color: MyColor.black,
      child: RtcView(
          url: "webrtc://192.168.2.220/live/mainstream_ff",
          localRender: _rtcVideoRenderer,
          selected: true,
          index: 0,),
    );
  }
}
